<template>
  <div class="autoPath" title="自动路径规划">
    <!-- 最优路劲航道规划 -->
    <div class="planchannel_inforation_map--addAouter_autoRouter">
      <div
        :class="{
          addAouter_autoRouter: true,
          'addAouter_autoRouter_start--befer': false,
        }"
      >
        <span>起点：</span>
        <p
          :class="{ dontContent: !isStartIdent, auto_p: true }"
          v-if="isStartDate && !isStartDate.id && !isStartDate.value"
        >
          {{ isStartIdent }}
        </p>
        <p
          :class="{ dontContent: !isStartIdent, auto_p: true }"
          v-if="isStartDate && isStartDate.id"
        >
          {{ isStartIdent }}
        </p>
        <p
          :class="{ dontContent: !isStartIdent, auto_p: true }"
          v-if="isStartDate && isStartDate.value"
        >
          {{ isStartIdent }}
        </p>
        <el-button
          type="success"
          icon="el-icon-check"
          circle
          @click="addReouterStartClick()"
          class="autoPath_button"
          v-if="isStart"
        ></el-button>
        <el-button
          type="primary"
          icon="el-icon-edit"
          circle
          class="autoPath_button"
          @click="addReouterStartClick()"
          v-else
        ></el-button>
      </div>
      <div class="addAouter_autoRouter" v-if="isStartDate && isStartDate.value">
        <span>起点半径：</span>
        <el-input
          type="number"
          v-model="input"
          placeholder="请输入内容"
          class="auto_input"
          @input="inputChange"
        ></el-input>
      </div>
      <div :class="{ addAouter_autoRouter: true, 'addAouter_autoRouter_start--befer': false }">
        <span>终点：</span>
        <p :class="{ dontContent: !isEndIdent, auto_p: true }">
          {{ isEndIdent }}
        </p>
        <el-button
          type="success"
          icon="el-icon-check"
          circle
          class="autoPath_button"
          @click="addReouterEndClick()"
          v-if="isEnd"
        ></el-button>
        <el-button
          type="primary"
          icon="el-icon-edit"
          circle
          class="autoPath_button"
          @click="addReouterEndClick()"
          v-else
        ></el-button>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: 'autoPath',
  components: {},
  props: {
    isStartDate: {
      type: Object,
    },
    isStartIdent: {
      type: String,
      // buttonClickData.channelAddData.isStartData.ident
    },
    isStart: {
      type: Boolean,
      // buttonClickData.channelAddData.isStart
    },
    startRadius: {
      type: String,
    },
    isEndIdent: {
      type: String,
      // buttonClickData.channelAddData.isEndData.ident
    },
    isEnd: {
      type: Boolean,
      // buttonClickData.channelAddData.isEnd
    },
    addReouterStartClick: {
      type: Function,
      required: true,
    },
    addReouterEndClick: {
      type: Function,
      required: true,
    },
  },
  data() {
    return {
      input: this.$props.startRadius,
    };
  },
  methods: {
    inputChange() {
      this.$emit('inputChange', this.input);
    },
  },
  created() {},
  mounted() {},
  watch: {},
};
</script>
<style lang="less" scoped>
.autoPath {
  .planchannel_inforation_map--addAouter_autoRouter {
    .addAouter_autoRouter {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-top: 3px;
      height: 24px;

      .auto_p {
        min-width: 70px;
        height: 100%;
        line-height: 24px;
      }
      .dontContent {
        border-bottom: 1px solid #333;
        box-sizing: border-box;
      }

      .autoPath_button {
        padding: 4px;
        margin-left: 4px;
      }
    }
    .addAouter_autoRouter_start--befer {
      background: #333;
    }
  }
  .auto_input {
    width: 50%;
  }
  /deep/.el-input__inner {
    height: 24px;
  }
}
</style>
